package com.hailian.fintech.hlhouse_statusserver.web;


import com.hailian.fintech.hlhouse_statusserver.mapper.AreaMapper;
import com.hailian.fintech.hlhouse_statusserver.service.IAreaService;
import com.hailian.fintech.hlhouse_statusserver.vo.ResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hanbo
 * @since 2020-06-01
 */
@RestController
@RequestMapping("/area")
public class AreaController {

    //注入areaservice
    @Autowired
    private IAreaService iAreaService;

    //注入areamapper
    @Autowired
    private AreaMapper areaMapper;

    /**
     * 测试方法
     * @return
     */
    @RequestMapping("list")
    public ResultEntity list(){
        return ResultEntity.ok(areaMapper.findByPid(1));
    }

    /**
     * 三级联动
     * @return
     */
    @RequestMapping("getAreaList")
    public ResultEntity getAreaList(){
        return ResultEntity.ok(iAreaService.getAreaList());
    }


}
